package gov.nasa.anml.parsing;

import java.io.IOException;
import java.io.InputStream;

import gov.nasa.anml.utility.SimpleString;
import org.antlr.runtime.*;

public class ANMLInputStream extends ANTLRInputStream implements ANMLCharStream {

	public ANMLInputStream() {
		super();
	}

	public ANMLInputStream(InputStream input, int size, int readBufferSize,
			String encoding) throws IOException {
		super(input, size, readBufferSize, encoding);
	}

	public ANMLInputStream(InputStream input, int size, String encoding)
			throws IOException {
		super(input, size, encoding);
	}

	public ANMLInputStream(InputStream input, int size) throws IOException {
		super(input, size);
	}

	public ANMLInputStream(InputStream input, String encoding)
			throws IOException {
		super(input, encoding);
	}

	public ANMLInputStream(InputStream input) throws IOException {
		super(input);
	}
	
	public char[] getData() {
		return data;
	}
	
	public SimpleString makeSimpleString(int start, int stop) {
		return new SimpleString(data,start,stop+1);
	}

	@Override
	public void consume() {
        if ( p < n ) {
			if ( data[p]=='\n' ) {
				line++;
				charPositionInLine=0;
			} else if (data[p]=='\t') {
				charPositionInLine+=4;
			} else {
				charPositionInLine+=1;
			}
            p++;
        }
	}
	

}
